#include<stdio.h>
//用比特位 标识状态
#define ONE 0x1   //0000 0001
#define TWO 0x2   //0000 0010
#define THREE 0x4 //0000 0100

void show(int flags) 
{
    if(flags & ONE)    //0000 0001
        printf("hello one\n");
    if(flags & TWO)    //0000 0010
        printf("hello two\n");
    if(flags & THREE)  //0000 0100
        printf("hello three\n");
}

int main()
{
    show(ONE); //000 0001
    printf("-----------------------------------------\n");

    show(TWO); //0000 0010
    printf("-----------------------------------------\n");

    show(ONE | TWO);  //000 0001 | 0000 0010 == 0000 0011
    printf("-----------------------------------------\n");
   
    show(ONE | THREE);
    printf("-----------------------------------------\n");

    show(ONE | TWO | THREE); //000 0001 | 0000 0010 | 0000 0100 == 0000 0111
    printf("-----------------------------------------\n");

    return 0;
}
